home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / PROGRAM / AEWIN100.ARJ / VIDCHR.H < prev    next >
C/C++ Source or Header  |  1991-10-27  |  2KB  |  56 lines

  1. /**********************************************************************
  2.  *  
  3.  *  NAME:           vidchr.h
  4.  *  
  5.  *  DESCRIPTION:    video character class
  6.  *  
  7.  *  copyright (c) 1990 J. Alan Eldridge
  8.  * 
  9.  *  M O D I F I C A T I O N   H I S T O R Y
  10.  *
  11.  *  when        who                 what
  12.  *  -------------------------------------------------------------------
  13.  *  10/27/90    J. Alan Eldridge    created
  14.  *  
  15.  *  10/29/90    JAE                 modified data structures
  16.  *                                  (interface stays the same)
  17.  *
  18.  *********************************************************************/
  19.  
  20. #ifndef __VIDCHR_H
  21. #define __VIDCHR_H
  22.  
  23. class vidchr {
  24.  
  25. private:
  26.  
  27.     enum { C, A };          //  array subscripts for ca[]
  28.     union {
  29.         short   i;
  30.         uchar   ca[2];
  31.     } vcu;                  //  character/attrib in Video RAM
  32.  
  33. public:
  34.  
  35.     //  set values
  36.     
  37.     void    put(int c)              { vcu.ca[C] = c; }
  38.     void    puta(int a)             { vcu.ca[A] = a; }
  39.     void    put(int c, int a)       { vcu.ca[C] = c; vcu.ca[A] = a; }
  40.     void    puti(int i)             { vcu.i = i; }
  41.     
  42.     //  get values
  43.     
  44.     int     get()                   { return vcu.ca[C]; }
  45.     int     geta()                  { return vcu.ca[A]; }
  46.     void    get(int &c, int &a)     { c = vcu.ca[C]; a = vcu.ca[A]; }
  47.     void    get(uchar &c, uchar &a) { c = vcu.ca[C]; a = vcu.ca[A]; }
  48.     int     geti()                  { return vcu.i; }
  49.  
  50. };
  51.  
  52. #endif  //  !defined(__VIDCHR_H)
  53.  
  54.  
  55.  
  56.